package com.ce.common.util;

import android.text.TextUtils;

/**
 * Created by LiLongHui on 2017/7/25.
 */

public class CheckUtil {
    public static final String PWD_REGULAR = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,10}$";

    /**
     * 验证手机号是否合法
     * @param phone 要验证的手机号
     * @return
     */
    public static boolean checkPhoneAvailable( String phone) {
        if (!TextUtils.isEmpty(phone)&&phone.replaceAll(" ","").length()==11){
            return true;
        }
        return false;
    }


    public static boolean checkPwdAcailable(String password){

        return password.matches(PWD_REGULAR);
    }



}
